<template>
  <view class="sellType">
    <up-radio-group :modelValue="modelValue.merchantCategory" @change="change">
      <up-radio
        v-for="(item, index) in radiolist"
        :key="index"
        :label="item.name"
        :name="item.type"
        activeColor="rgba(54, 161, 238, 1)"
        :customStyle="customStyleItem"
        size="26rpx"
        labelSize="26rpx"
      >
      </up-radio>
    </up-radio-group>
  </view>
</template>

<script setup>
import { ref, toRef, inject, computed, watch, nextTick } from 'vue';

import { sellType as radiolist } from '@/utils/enums/index.js';

const rules = inject('rules');

const props = defineProps({
  modelValue: {
    type: Object,
    default: () => {},
  },
});
const modelValue = computed(() => props.modelValue);
const emit = defineEmits(['update:modelValue']);

console.log('modelValue', modelValue.value.merchantCategory);

const change = (name) => {
  emit('update:modelValue', {
    ...props.modelValue,
    merchantCategory: name,
  });
};

const customStyleItem = {
  color: '#333333',
};
</script>

<style lang="scss">
.sellType {
  padding: 23rpx 40rpx;
}
</style>
